#import "PointOfInterestDataUtility.h"

/**
 * A generic utility class for creating and testing the point 
 * of interest collection type.
 * 
 * @author      Justin Hollander
 * @author      Philip Chau
 * @author      Eric Johnson
 * @author      James Lin
 * @version     1.3.3
 * @since       1.2.3
 */
@implementation PointOfInterestDataUtility

/**
 * Create the archived data file containing all the static point 
 * of interest data needed and supported by this application.
 */
+ (void)buildPOICollection {
	// Create the empty data file
	PointOfInterestCollection* poic = [[PointOfInterestCollection alloc] initWithEmptyFile:POI_FILENAME 
																		 usingSubdirectory:POI_SUBDIRECTORY];
	
	// Create the GPS locations for each point of interest
	GPSLocation* g1 = [[GPSLocation alloc] initWithDetails:49.277544 lon:-122.912141];	//check
	GPSLocation* g2 = [[GPSLocation alloc] initWithDetails:49.277893 lon:-122.911794];  //check
	GPSLocation* g3 = [[GPSLocation alloc] initWithDetails:49.277907 lon:-122.911890];  //check
	GPSLocation* g4 = [[GPSLocation alloc] initWithDetails:49.277520 lon:-122.912209];	//check
	GPSLocation* g5 = [[GPSLocation alloc] initWithDetails:49.277397 lon:-122.912280];  //check
	
	GPSLocation* g6 = [[GPSLocation alloc] initWithDetails:49.277860 lon:-122.912381];
	GPSLocation* g7 = [[GPSLocation alloc] initWithDetails:49.278877 lon:-122.919239];  //check
	GPSLocation* g8 = [[GPSLocation alloc] initWithDetails:49.278702 lon:-122.918982];  //check
	GPSLocation* g9 = [[GPSLocation alloc] initWithDetails:49.278643 lon:-122.919185];	//check
	GPSLocation* g10 = [[GPSLocation alloc] initWithDetails:49.278095 lon:-122.912046];  //check
	
	GPSLocation* g11 = [[GPSLocation alloc] initWithDetails:49.278294 lon:-122.912339];  //check
	GPSLocation* g12 = [[GPSLocation alloc] initWithDetails:49.278154 lon:-122.911771];	 //check
	GPSLocation* g13 = [[GPSLocation alloc] initWithDetails:49.279314 lon:-122.917269];
	GPSLocation* g14 = [[GPSLocation alloc] initWithDetails:49.279940 lon:-122.921717];
	GPSLocation* g15 = [[GPSLocation alloc] initWithDetails:49.278809 lon:-122.915533];
	
	GPSLocation* g16 = [[GPSLocation alloc] initWithDetails:49.278214 lon:-122.912692];  //check
	GPSLocation* g17 = [[GPSLocation alloc] initWithDetails:49.279085 lon:-122.919038];
	GPSLocation* g18 = [[GPSLocation alloc] initWithDetails:49.279260 lon:-122.922724];
	GPSLocation* g19 = [[GPSLocation alloc] initWithDetails:49.279276 lon:-122.921208];
	GPSLocation* g20 = [[GPSLocation alloc] initWithDetails:49.278968 lon:-122.920471];
	
	GPSLocation* g21 = [[GPSLocation alloc] initWithDetails:49.278612 lon:-122.912947];  //check
	GPSLocation* g22 = [[GPSLocation alloc] initWithDetails:49.276594 lon:-122.915752];  //check
	GPSLocation* g23 = [[GPSLocation alloc] initWithDetails:49.279867 lon:-122.920228];  //check
	GPSLocation* g24 = [[GPSLocation alloc] initWithDetails:49.280117 lon:-122.922826];
	GPSLocation* g25 = [[GPSLocation alloc] initWithDetails:49.279453 lon:-122.919910];
	
	GPSLocation* g26 = [[GPSLocation alloc] initWithDetails:49.276948 lon:-122.911179];
	GPSLocation* g27 = [[GPSLocation alloc] initWithDetails:49.280204 lon:-122.912603];
	GPSLocation* g28 = [[GPSLocation alloc] initWithDetails:49.278346 lon:-122.909532];
	GPSLocation* g29 = [[GPSLocation alloc] initWithDetails:49.276658 lon:-122.907703];
	GPSLocation* g30 = [[GPSLocation alloc] initWithDetails:49.278067 lon:-122.911885];  //check
	
	GPSLocation* g31 = [[GPSLocation alloc] initWithDetails:49.278702 lon:-122.919033];  //check
	
	// Tags for each point of interest; optional
	NSMutableArray* t1 = [NSMutableArray array];
	[t1 addObject:@"plum garden noodle"];
	[t1 addObject:@"plum noodle house"];
	[t1 addObject:@"garden noodle house"];
	NSMutableArray* t5 = [NSMutableArray array];
	[t5 addObject:@"bamboo garden"];
	[t5 addObject:@"bamboo chinese restaurant"];
	[t5 addObject:@"garden chinese restaurant"];
	NSMutableArray* t9 = [NSMutableArray array];
	[t9 addObject:@"ladle"];
	NSMutableArray* t13 = [NSMutableArray array];
	[t13 addObject:@"triple o's"];
	[t13 addObject:@"ooo"];
	[t13 addObject:@"ooo's"];
	[t13 addObject:@"o o o"];
	NSMutableArray* t14 = [NSMutableArray array];
	[t14 addObject:@"tim's"];
	[t14 addObject:@"timmy's"];
	NSMutableArray* t15 = [NSMutableArray array];
	[t15 addObject:@"mackenzie"];
	NSMutableArray* t16 = [NSMutableArray array];
	[t16 addObject:@"club ilia"];
	[t16 addObject:@"club ilia eatery"];
	[t16 addObject:@"club ilia lounge"];
	[t16 addObject:@"ilia eatery"];
	[t16 addObject:@"ilia lounge"];
	NSMutableArray* t19 = [NSMutableArray array];
	[t19 addObject:@"pool"];
	NSMutableArray* t20 = [NSMutableArray array];
	[t20 addObject:@"security"];
	[t20 addObject:@"lost and found"];
	[t20 addObject:@"lost & found"];
	NSMutableArray* t24 = [NSMutableArray array];
	[t24 addObject:@"west mall parking"];
	NSMutableArray* t25 = [NSMutableArray array];
	[t25 addObject:@"convocation mall parking"];
	NSMutableArray* t26 = [NSMutableArray array];
	[t26 addObject:@"b lot"];
	NSMutableArray* t27 = [NSMutableArray array];
	[t27 addObject:@"c lot"];
	NSMutableArray* t28 = [NSMutableArray array];
	[t28 addObject:@"e lot"];
	NSMutableArray* t29 = [NSMutableArray array];
	[t29 addObject:@"g lot"];
	NSMutableArray* t31 = [NSMutableArray array];
	[t31 addObject:@"bubble tea"];
	
	// Create the points of interest
	PointOfInterest* p1 = [[PointOfInterest alloc] 	initWithDetails: @"Plum Garden Noodle House" 	
															  point:g1
														   category:PointOfInterestCategoryRestaurant 
															tagList:t1 
														   selected:NO];
	PointOfInterest* p2 = [[PointOfInterest alloc] 	initWithDetails: @"Donair Town" 	
															  point:g2 
														   category:PointOfInterestCategoryRestaurant  
														   selected:NO];
	PointOfInterest* p3 = [[PointOfInterest alloc] 	initWithDetails: @"Pizza Point" 
															  point:g3 
														   category:PointOfInterestCategoryRestaurant 
														   selected:NO];
	PointOfInterest* p4 = [[PointOfInterest alloc] 	initWithDetails: @"Spicy Stone" 	
															  point:g4
														   category:PointOfInterestCategoryRestaurant 
														   selected:NO];
	PointOfInterest* p5 = [[PointOfInterest alloc] 	initWithDetails: @"Bamboo Garden Chinese Restaurant" 
															  point:g5 
														   category:PointOfInterestCategoryRestaurant 
															tagList:t5
														   selected:NO];
	PointOfInterest* p6 = [[PointOfInterest alloc] 	initWithDetails: @"Himalayan Peak" 				
															  point:g6 
														   category:PointOfInterestCategoryRestaurant  
														   selected:NO];
	PointOfInterest* p7 = [[PointOfInterest alloc] 	initWithDetails: @"Koya" 		
															  point:g7 
														   category:PointOfInterestCategoryRestaurant 
														   selected:NO];
	PointOfInterest* p8 = [[PointOfInterest alloc] 	initWithDetails: @"Mr. Sub" 		
															  point:g8 
														   category:PointOfInterestCategoryRestaurant 
														   selected:NO];
	PointOfInterest* p9 = [[PointOfInterest alloc] 	initWithDetails: @"The Ladle" 		
															  point:g9 
														   category:PointOfInterestCategoryRestaurant
															tagList:t9 
														   selected:NO];
	PointOfInterest* p10 = [[PointOfInterest alloc] initWithDetails: @"Subway"			
															  point:g10 
														   category:PointOfInterestCategoryRestaurant
														   selected:NO];
	PointOfInterest* p11 = [[PointOfInterest alloc] initWithDetails: @"Ichibankan Express" 	
															  point:g11
														   category:PointOfInterestCategoryRestaurant 
														   selected:NO];
	PointOfInterest* p12 = [[PointOfInterest alloc] initWithDetails: @"Nature's Garden" 	
															  point:g12 
														   category:PointOfInterestCategoryRestaurant 
														   selected:NO];
	PointOfInterest* p13 = [[PointOfInterest alloc] initWithDetails: @"Triple-O's" 		
															  point:g13 
														   category:PointOfInterestCategoryRestaurant 
															tagList:t13 
														   selected:NO];
	PointOfInterest* p14 = [[PointOfInterest alloc] initWithDetails: @"Tim Hortons" 		
															  point:g14 
														   category:PointOfInterestCategoryRestaurant 
															tagList:t14 
														   selected:NO];
	PointOfInterest* p15 = [[PointOfInterest alloc] initWithDetails: @"Mackenzie Cafe" 		
															  point:g15 
														   category:PointOfInterestCategoryRestaurant
															tagList:t15 
														   selected:NO];
	PointOfInterest* p16 = [[PointOfInterest alloc] initWithDetails: @"Club Ilia Eatery & Lounge" 	
															  point:g16 
														   category:PointOfInterestCategoryPub 
															tagList:t16 
														   selected:NO];
	PointOfInterest* p17 = [[PointOfInterest alloc] initWithDetails: @"Highland Pub" 		
															  point:g17 
														   category:PointOfInterestCategoryPub 
														   selected:NO];
	PointOfInterest* p18 = [[PointOfInterest alloc] initWithDetails: @"Gym" 		
															  point:g18 
														   category:PointOfInterestCategoryGym 
														   selected:NO];
	PointOfInterest* p19 = [[PointOfInterest alloc] initWithDetails: @"Swimming Pool" 	
															  point:g19 
														   category:PointOfInterestCategoryGym 
															tagList:t19 
														   selected:NO];
	PointOfInterest* p20 = [[PointOfInterest alloc] initWithDetails: @"Campus Security" 
															  point:g20
														   category:PointOfInterestCategorySecurity 
															tagList:t20 
														   selected:NO];
	PointOfInterest* p21 = [[PointOfInterest alloc] initWithDetails: @"Main Stop" 		
															  point:g21 
														   category:PointOfInterestCategoryBusStop 
														   selected:NO];
	PointOfInterest* p22 = [[PointOfInterest alloc] initWithDetails: @"Side Stop" 			
															  point:g22
														   category:PointOfInterestCategoryBusStop
														   selected:NO];
	PointOfInterest* p23 = [[PointOfInterest alloc] initWithDetails: @"Entrance Stop" 	
															  point:g23 
														   category:PointOfInterestCategoryBusStop
														   selected:NO];
	PointOfInterest* p24 = [[PointOfInterest alloc] initWithDetails: @"West Mall Parkade" 		
															  point:g24 
														   category:PointOfInterestCategoryParkingLot 
															tagList:t24
														   selected:NO];
	PointOfInterest* p25 = [[PointOfInterest alloc] initWithDetails: @"Convocation Mall Parkade" 	
															  point:g25
														   category:PointOfInterestCategoryParkingLot
															tagList:t25 
														   selected:NO];
	PointOfInterest* p26 = [[PointOfInterest alloc] initWithDetails: @"Parking Lot B" 	
															  point:g26
														   category:PointOfInterestCategoryParkingLot 
															tagList:t26 
														   selected:NO];
	PointOfInterest* p27 = [[PointOfInterest alloc] initWithDetails: @"Parking Lot C" 	
															  point:g27
														   category:PointOfInterestCategoryParkingLot 
															tagList:t27 
														   selected:NO];
	PointOfInterest* p28 = [[PointOfInterest alloc] initWithDetails: @"Parking Lot E" 	
															  point:g28 
														   category:PointOfInterestCategoryParkingLot 
															tagList:t28 
														   selected:NO];
	PointOfInterest* p29 = [[PointOfInterest alloc] initWithDetails: @"Parking Lot G" 	
															  point:g29 
														   category:PointOfInterestCategoryParkingLot 
															tagList:t29 
														   selected:NO];
	PointOfInterest* p30 = [[PointOfInterest alloc] initWithDetails: @"Booster Juice" 	
															  point:g30
														   category:PointOfInterestCategoryRestaurant 
														   selected:NO];
	PointOfInterest* p31 = [[PointOfInterest alloc] initWithDetails: @"Bubble World" 	
															  point:g31 
														   category:PointOfInterestCategoryRestaurant 
															tagList:t31 
														   selected:NO];
	
	// Add the points of interest to the collection
	[poic addDataType:p1];
	[poic addDataType:p2];
	[poic addDataType:p3];
	[poic addDataType:p4];
	[poic addDataType:p5];
	[poic addDataType:p6];
	[poic addDataType:p7];
	[poic addDataType:p8];
	[poic addDataType:p9];
	[poic addDataType:p10];
	[poic addDataType:p11];
	[poic addDataType:p12];
	[poic addDataType:p13];
	[poic addDataType:p14];
	[poic addDataType:p15];
	[poic addDataType:p16];
	[poic addDataType:p17];
	[poic addDataType:p18];
	[poic addDataType:p19];
	[poic addDataType:p20];
	[poic addDataType:p21];
	[poic addDataType:p22];
	[poic addDataType:p23];
	[poic addDataType:p24];
	[poic addDataType:p25];
	[poic addDataType:p26];
	[poic addDataType:p27];
	[poic addDataType:p28];
	[poic addDataType:p29];
	[poic addDataType:p30];
	[poic addDataType:p31];
	
	// Test tag count for every point of interest
	/*
	NSArray* poicList = [poic getDataTypes];
	
	for(PointOfInterest* poi in poicList) {
		NSLog(@"%@ (%d)", poi.name, [poi.poiTags count]);
	}
	*/
}

@end